package com.hjx.windowtool;

import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;

import org.bytedeco.javacpp.opencv_core.DMatch;
import org.bytedeco.javacpp.opencv_core.DMatchVector;
import org.bytedeco.javacpp.opencv_core.Mat;
import org.bytedeco.javacpp.opencv_core.MatVector;
import org.bytedeco.javacpp.opencv_features2d;
import org.bytedeco.javacpp.opencv_features2d.FlannBasedMatcher;
import org.bytedeco.javacpp.opencv_highgui;
import org.bytedeco.javacpp.opencv_imgcodecs;
import org.bytedeco.javacpp.opencv_stitching.ImageFeatures;
import org.bytedeco.javacpp.opencv_stitching.Stitcher;
import org.bytedeco.javacpp.opencv_stitching.SurfFeaturesFinder;


public class JavacvTest {
	private String name;

	public static void main(String[] args) throws Exception {
		System.out.println(URLEncoder.encode("http://pay.dongluhitec.net/p/BLVO1cWj9", "UTF-8"));
		System.out.println((new byte[100]) instanceof byte[]);
//		Mat image1 = opencv_imgcodecs.imread("e://img//123.jpg");
//		Mat image2 = opencv_imgcodecs.imread("e://img//1.jpg");
		
		
//		Stitcher s=Stitcher.createDefault(false);
//		MatVector images = new MatVector();
//		images.push_back(image1);
//		images.push_back(image2);
//		Mat pano = new Mat();
//		int stitch = s.stitch(images, pano);
//		System.out.println(stitch);
//		opencv_imgcodecs.imwrite("e://img//666.jpg", pano);
		
//		SurfFeaturesFinder sff=new SurfFeaturesFinder(2000);
//		ImageFeatures features1 = new ImageFeatures();
//		sff.apply(image1, features1);
//		
//		ImageFeatures features2 = new ImageFeatures();
//		sff.apply(image2, features2);
//		System.out.println(features1.keypoints().size()+"==="+features2.keypoints().size());
//		
//		FlannBasedMatcher fbm=new FlannBasedMatcher();
//		
//		Mat outImage1=new Mat();
//		opencv_features2d.drawKeypoints(image1, features1.keypoints(), outImage1);
//		Mat outImage2=new Mat();
//		opencv_features2d.drawKeypoints(image2, features2.keypoints(), outImage2);
//		DMatchVector matches = new DMatchVector();
//		matches.push_back(new DMatch(outImage1.ptr()));
//		fbm.match(outImage2, matches);
	}
	
	public void setName(String name) {
		this.name = name;
	}
}
